#ifndef MATH_VEC4_H_
#define MATH_VEC4_H_


namespace math
{

///////////////////////////////////////////////////////
///	\brief	Vector class that provides basic vector functionality
/// flexibility is preferred over speed.
///////////////////////////////////////////////////////
class Vec4
{
  public:
	Vec4(float* _Vec);
	Vec4(float _x,float _y,float _z,float _w);
	Vec4();
	
	inline float	Magnitude() const;
	inline float	MagSqr() const;
	inline	float	Manhatten() const;
	Vec4			Normalize();
	int				Concurrent(const Vec4&) const;
	Vec4&			Modulate(const Vec4& _Val);	// (This.x*_Val.x, This.y*_Val.y, This.z*_Val.z);

	Vec4			LowVec(const Vec4& _A) const;
	Vec4			HighVec(const Vec4& _A) const;

	void			Reset();

	float*			Get() { return &x; };
	// access points for LUA Bind
	float			GetX() const { return x; };
	void			SetX(float f) { x = f; };
	float			GetY() const { return y; };
	void			SetY(float f) { y = f; };
	float			GetZ() const { return z; };
	void			SetZ(float f) { z = f; };
	float			GetW() const { return w; };
	void			SetW(float f) { w = f; };

	// Get adress
	operator float *() { return &x;};
	Vec4& operator = ( const Vec4& _Vec) ;
	Vec4& operator+= ( const Vec4& _Vec) ;
	Vec4& operator-= ( const Vec4& _Vec) ;
	Vec4& operator*= ( const float& _f) ;
	Vec4& operator/= ( const float& _f) ;

	float			x, y, z, w;
};
} // end namespace math

math::Vec4 LerpVec4(const math::Vec4& From, const math::Vec4& To, float t);

// Operator overloads for vectors
math::Vec4 operator+(const math::Vec4&  vVec1, const math::Vec4&  vVec2);
math::Vec4 operator-(const math::Vec4&  vVec) ;
math::Vec4 operator-(const math::Vec4&  vVec1, const math::Vec4&  vVec2) ;
math::Vec4 operator*(const math::Vec4&  vVec1, float fScalar) ;
math::Vec4 operator*(float fScalar, const math::Vec4&  vVec1) ;
math::Vec4 operator/(const math::Vec4&  vVec1,float fScalar) ;
float   operator^(const math::Vec4&  vVec1, const math::Vec4&  vVec2) ;   // DOT product



#endif // MATH_VEC4_H_